#include<stdio.h>
int main()
{
  int n,j1,j2,y1,y2;
  int i;
  int s1=0,s2=0;
  scanf("%d",&n);
  for(i=0;i<n;i++)
    {
      scanf("%d%d%d%d",&j1,&j2,&y1,&y2);
      if(j2==j1+y1&&y2!=j1+y1)
        s2++;
        else if(y2==j1+y1&&j2!=j1+y1)
        s1++;
        else;
    }
    printf("%d %d\n",s1,s2);
  return 0;
}